package com.acoffee.java;

/**
 * 单例双夹
 * @author acoffee
 * @create 2021-11-09 16:41
 */
public class Singtlon {
    private static volatile Singtlon instance = null;

    public Singtlon getInstance(){
        if (instance != null){
            synchronized (Singtlon.class){
                if (instance != null){
                    instance = new Singtlon();
                }
            }
        }
        return instance;
    }

}
